/*
 * @Descripttion:
 * @version:
 * @Author: sueRimn
 * @Date: 2020-10-29 08:54:54
 * @LastEditors: sueRimn
 * @LastEditTime: 2020-11-03 16:30:19
 */
import request from '@/utils/request'
import store from '@/store/index'
const base = require('../../env/index')

// 夹带k_token
function addK_Token(data) {
    var token = {
        k_token: store.getters.k_token
    }
    Object.assign(data, token)
    return data
}
/**
 * 新增组卷信息
 */
export function addPaper(data) {
    return request({
        url: base.question_url + '/api/v1/admin/zoom/save',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 * 添加组卷
 */
export function addSelectPaper(data) {
    return request({
        url: base.question_url + '/api/v1/admin/zoom/choose',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 * 查询组卷信息
 */
export function searchPaper(data) {
    return request({
        url: base.question_url + '/api/v1/admin/zoom/info/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
 * 获取单问卷信息
 */
export function getGroupSingle(data) {
    return request({
        url: base.question_url + '/api/v1/admin/group/info/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 * 获取单问卷信息
 */
export function getZoomSingle(data) {
    return request({
        url: base.question_url + '/api/v1/admin/zoom/info/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
 * 问题排序
 */
export function questionSort(data) {
    return request({
        url: base.question_url + '/api/v1/admin/question/sort/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

